home *** CD-ROM | disk | FTP | other *** search
- Unit UserLib;
- interface
- uses crt,dos;
- type
- MenuList = Array[0..9] of String[40];
- const
- HexChars : Array[1..16] of Char =
- ('0','1','2','3','4','5','6','7',
- '8','9','A','B','C','D','E','F');
- {keyboard constants}
- {ASCII Dec Description}
- NUL = #000; {CTRL @ Null}
- SOH = #001; {CTRL A Start of header}
- STX = #002; {CTRL B Start of text}
- ETX = #003; {CTRL C End of text}
- EOT = #004; {CTRL D End of transmission}
- ENQ = #005; {CTRL E Enquiry}
- ACK = #006; {CTRL F Acknowledge}
- BEL = #007; {CTRL G Bell}
- BS = #008; {CTRL H Backspace}
- TAB = #009; {CTRL I Horizontal tab}
- LF = #010; {CTRL J Line Feed}
- VT = #011; {CTRL K Vertical tab}
- FF = #012; {CTRL L Form feed}
- CR = #013; {CTRL M Carriage return}
- SO = #014; {CTRL N Shift out}
- SI = #015; {CTRL O Shift in}
- DLE = #016; {CTRL P Data link escape}
- DC1 = #017; {CTRL Q Dev. control 1 (XON)}
- DC2 = #018; {CTRL R Dev. control 2}
- DC3 = #019; {CTRL S Dev. control 3 (XOFF)}
- DC4 = #020; {CTRL T Dev. control 4}
- NAK = #021; {CTRL U Negative acknowledge}
- SYN = #022; {CTRL V Synchronous idle (SYNC)}
- ETB = #023; {CTRL W End of transmission block}
- CAN = #024; {CTRL X Cancel}
- EM = #025; {CTRL Y End of medium}
- SUB = #026; {CTRL Z Substitute}
- ESC = #027; {CTRL [ Escape}
- FS = #028; {CTRL \ File seperator}
- GS = #029; {CTRL ] Group seperator}
- RS = #030; {CTRL ^ Record seperator}
- US = #031; {CTRL _ Unit seperator}
- { #032 to #0126 are normal ASCII characters}
- { DEL = #127; (Delete/Rubout) }
- {translated extended codes
- codes above 127 are not generated directly from keyboard
- they are translations of the actual 2 character sequence
- (NUL xx) obtained by adding 128 to the xx character}
- F1 = #187;
- F2 = #188;
- F3 = #189;
- F4 = #190;
- F5 = #191;
- F6 = #192;
- F7 = #193;
- F8 = #194;
- F9 = #195;
- F10 = #196;
- HOMEKEY = #199;
- UPKEY = #200;
- PGUPKEY = #201;
- LEFTKEY = #203;
- RIGHTKEY = #205;
- ENDKEY = #207;
- DOWNKEY = #208;
- PGDNKEY = #209;
- INSKEY = #210;
- DELKEY = #211;
- CTRLLEFTKEY = #243;
- CTRLRIGHTKEY = #244;
- var
- Back,Txt: byte; Field: integer;
-
- procedure Abort(msg:String);
- {display message and halt}
-
- procedure Beep;
- {sound beeper}
-
- procedure CursorType(S:char);
- {set cursor to B-Block, U-Underline or O-Off}
-
- procedure ClrLine(Col,Row:byte);
- {clear line to spaces on crt}
-
- procedure Display_Int(Col,Row,Txt,Back:byte; Rev:Boolean;
- I:integer; Width:byte);
- { Writes an integer on screen at Col,Row, possibly reverse video}
-
- procedure Display_Real(Col,Row,Txt,Back:byte; Rev:Boolean;
- R:real; Width,Dec:byte);
- { Writes a real number on screen at Col,Row, possibly reverse video}
-
- procedure Display_Str(Col,Row,Txt,Back:byte; Rev:Boolean;
- S:String);
- { Writes a string on screen at Col,Row, possibly reverse video}
-
- function Exists(FileName : String) : Boolean;
- { Returns True if the file FileName exists, False otherwise }
-
- function GetHex(Decimal_Value:Word):string;
- {convert value to Hex string for display}
-
- procedure Inp_Int(Col,Row,Txt,Back:byte;
- var I:integer; Max:byte);
- {Input an integer up to max digits from screen at Col,Row}
-
- procedure Inp_Real(Col,Row,Txt,Back:byte;
- var R:real; Max,Frac:byte);
- {Input a real number from screen - Max chars (including sign & decimal point)
- with up to Frac decimal places}
-
- procedure Inp_Str(Col,Row,Txt,Back:byte;
- var S:String; Max:byte; Shift:char);
- {Input a string from screen at Col,Row in a reverse video box}
-
- function KeyInp : Char;
- { Reads the next keyboard character, translates special keys }
-
- procedure Menu(var Items: MenuList; var Choice: integer;
- Max,Txt,Back:byte);
- {display a list of items and return selection
- Parameters are Items - array of items to display
- Choice - number of item chosen
- Max - number of items
- Txt - Text Color
- Back - Background Color}
-
- procedure Message(Msg:String);
- {display msg on line 23 and pause}
-
- function PadStr(S:string; L:byte; C:char; J:char):string;
- {pad string S to length L with character C justified J('R' or 'L')}
-
- procedure Pause;
- {print message on line 24 and wait for input}
-
- function PurgeCh(InS:string; C:char):string;
- {delete all occurences of C from S}
-
- function Yes_No(Prompt:string):char;
- {print message on line 24 and wait for input}